package main

import (
	"testing"
	"fmt"
)

func BenchmarkLoop(b *testing.B) {
	ch:=make(chan int)
	go func(){
		for i:=0; i<b.N; i++ {
			ch <- i
		}
		close(ch)
	}()

	for range ch {}
}

func main() {
	fmt.Println(testing.Benchmark(BenchmarkLoop))
}
